<?php
/**
 * 会员现金管理:充值、提现、资金走向
 */
defined('InTuntronKJ') or exit('Access Invalid!');

class cashModel extends Model {
	
	public function __construct(){
        parent::__construct('member_cash');
    }

	/**
	 * 添加会员提现信息
	 * @param unknown_type $param
	 */
    public function addUserCash($param){
        return $this->insert($param);
    }
    
  
    /**
     * 获取银行列表
     * 
     */
    public function getBankList(){
    	return $this->table('bank_list')->select();
    }
    
    
    /**
     * 获取银行详细信息
     * 
     */
    public function getBankInfo($condition, $field = '*'){
    	return $this->table('bank_list')->where($condition)->find();
    }
    
    /**
     * 提现记录
     * @param unknown $condition
     * @param string $field
     * @param number $page
     * @param number $limit
     * @param string $order
     */
    public function getCashList($condition = array(), $field = '*', $page = 0, $limit = 0,$order = 'id desc'){
    	return $this->where($condition)->limit($limit)->page($page)->order($order)->select();
    }
    
	/**
	 * 提现记录数量
	 * @param unknown $condition
	 */
    public function getCashCount($condition){
    	return $this->where($condition)->count();
    }
    
    /**
     * 充值记录
     * @param unknown $condition
     * @param string $field
     * @param number $page
     * @param number $limit
     * @param string $order
     */
    public function getRechargeList($condition = array(), $field = '*', $page = 0, $limit = 0,$order = 'uid desc'){
    	return $this->table('member_recharge')->where($condition)->limit($limit)->page($page)->order($order)->select();
    }
    
    /**
     * 充值记录数量
     * @param unknown $condition
     */
    public function getRechargeCount($condition){
    	return $this->table('member_recharge')->where($condition)->count();
    }
        
}